import * as request from "@/utils/request"

const apiPrefix = "/api/questionBankQuestion"

/**
 * 查询题目所属题库
 */
export function listQuestionBankQuestionVOByPage(params: QuestionBankQuestionQueryRequest) {
  return request.post<PageQuestionBankQuestionVO>({
    url: apiPrefix + "/list/page/vo",
    data: params
  })
}

/**
 * 绑定所属题库
 */
export function addQuestionBankQuestion(params: QuestionBankQuestionAddRequest) {
  return request.post<number>({
    url: apiPrefix + "/add",
    data: params
  })
}

/**
 * 取消绑定所属题库
 */
export function removeQuestionBankQuestion(params: QuestionBankQuestionRemoveRequest) {
  return request.post<boolean>({
    url: apiPrefix + "/delete",
    data: params
  })
}

/**
 * 批量向题库添加题目
 */
export function batchAddQuestionsToBank(params: QuestionBankQuestionBatchAddRequest) {
  return request.post<boolean>({
    url: apiPrefix + "/add/batch",
    data: params
  })
}

/**
 * 批量从题库移除题目
 */
export function batchRemoveQuestionsFromBank(params: QuestionBankQuestionBatchRemoveRequest) {
  return request.post<boolean>({
    url: apiPrefix + "/remove/batch",
    data: params
  })
}
